const calc = () => {
  let rem = 100; // 设置1rem = 多少像素
  let changeWidth = 720; //设置开始计算的宽度
  const width = document.documentElement.clientWidth;
  const px =
    rem * (width / changeWidth) > rem
      ? rem + "px"
      : rem * (width / changeWidth) + "px";
  document.documentElement.style.fontSize = px;
};

window.addEventListener("load", calc);
window.addEventListener("resize", calc);
